/*
 * @Author: 邱狮杰
 * @Date: 2021-06-27 12:47:48
 * @LastEditTime: 2021-06-27 13:39:25
 * @FilePath: /catch-null-value/src/entry.ts
 * @Description: entry
 */
// const parser = require("@babel/parser");
// const traverse = require("@babel/traverse").default;
// const generate = require("@babel/generator").default;
import { declare } from "@babel/helper-plugin-utils";
// import { readFileSync } from "fs";
// import { resolve } from "path";
// const file = readFileSync(resolve(__dirname, "./index.js"), "utf-8");
// const ast = parser.parse(file, {
//   sourceType: "unambiguous",
// });
// traverse(ast, {
//   CallExpression(path: any) {
//     console.log(path);
//   },
// });
const autoDocumentPlugin = declare(() => {
  return {
    visitor: {
      CallExpression(path: any) {
        console.log(path.container.leadingComments);
      },
    },
  };
});
module.exports = autoDocumentPlugin;
